<?php
/*
	门店参数设置
*/
defined('BY_JYA') or exit('error');
global $_AR;
		$setting=$this->get_setting();	
		if(empty($plate1) || empty($plate2)) return false;
		$cityconfig = $this->lubang_cities();
		foreach($cityconfig['data'] as $key => $value){
			if($value['province_short_name'] == $plate1){
				foreach($value['citys'] as $key1 => $value1){
					if($value1['car_head'] == $plate1.$plate2){
						$config_city = $value1;
					}
				}
				if(empty($config_city)){
					$config_city = $value['citys'][0];
				}
			}
		}
		if(empty($config_city)) return false;
		//发动机号
		switch ($config_city['engine_num']) {
			case -1:
				$engineno = $engine_number;
				break;
			case 0:
				$engineno = '';
				break;
			default:
				$engineno = substr($engine_number,-$config_city['engine_num']);
				break;
		}
		//车架号
		switch ($config_city['body_num']) {
			case -1:
				$frameno = $frame_number;
				break;
			case 0:
				$frameno = '';
				break;
			default:
				$frameno = substr($frame_number,-$config_city['body_num']);
				break;
		}
		$car_info = "{plate_num:".$plate1.$plate2.$plate_number.",body_num:".$frameno.",engine_num:".$engineno.",city_id:".$config_city['city_id'].",car_type:02}";
		$sign = md5($setting['lubang_apiid'].$car_info.microtime().$setting['lubang_appkey']);
		$url = "http://wz.loopon.cn/traffic_violation/api/v1/query?car_info=".$car_info."&api_id=".$setting['lubang_apiid']."&sign=".$sign."&timestamp=".time();
		$data = cfc('http')->ihttp_request($url);
		$historys=$data['content'];
		$historys=json_decode($historys,true);
return $historys;